<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">

        <!-- 只渲染元素和组件一次。随后的重新渲染，元素/组件及其所有的子节点将被视为静态内容并跳过。这可以用于优化更新性能。 -->

        <h1  v-once> {{msg}}</h1>

        <hr>
        <h1> {{msg}}</h1>
     
    </div>
    <script src="./vue.js"></script>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                msg:"hello  once   xxxxxx "
            },
            methods: {}
        });

        setTimeout(() => {
              console.log(vm);
              vm.msg=' 我是改变了'
        }, 2000);
    </script>
</body>

</html>